package com.fr.privilege.authentication;

import com.fr.privilege.authority.Authority;

public class FreeAuthentication extends AbstractAuthentication
{
  private static final long serialVersionUID = 5794585709061643035L;
  private String username;

  public FreeAuthentication()
  {
    this(new Authority[0]);
  }

  public FreeAuthentication(Authority paramAuthority)
  {
    this(new Authority[] { paramAuthority });
  }

  public FreeAuthentication(Authority[] paramArrayOfAuthority)
  {
    this(null, paramArrayOfAuthority);
  }

  public FreeAuthentication(String paramString, Authority[] paramArrayOfAuthority)
  {
    this.username = null;
    this.username = paramString;
    setAuthorities(paramArrayOfAuthority);
    setAuthenticated(true);
  }

  public Object getCredentials()
  {
    return null;
  }

  public Object getPrincipal()
  {
    return this.username;
  }
}